package enum_;
/*
自定义类实现枚举：
    1.私有方法私有，不允许外部创建对象，类内部可以创建，保证数量是固定的
    2.枚举对象通常使用大写
    3.对枚举对象（属性）使用static final修饰，保证是常量，
    能够通过类名.去访问（暴露给外部访问的一个入口）
    4.不需要提供setXxx（）方法，枚举对象通常为只读
 */
public class Demo {
    public static void main(String[] args) {
        //new Week()
        System.out.println(Week.FRIDAY);
    }
}
class Week {
    private String name;
    private int id;
    private Week() {

    }
    private Week (String name,int id) {
        this.name = name;
        this.id = id;
    }
    //定义周几的常亮对象
    public static final Week MONDAY = new Week("星期一",1);
    public static final Week TUESDAY = new Week("星期二",2);
    public static final Week WEDNESDAY = new Week("星期三",3);
    public static final Week THURSDAY = new Week("星期四",4);
    public static final Week FRIDAY = new Week("星期五",5);
    public static final Week SATURDAY = new Week("星期六",6);
    public static final Week SUNDAY = new Week("星期天",7);

}

